package edu.java.texbooks.scjp.test01;

public class TestClass {
    public static void test(final MyClass finalObject, MyClass object){
	
//	finalObject= null;    // it is a error because we have "final" modifier
	object.setA(10);
	object.setB(11);
	
	// test local variable
	final int testLocalVariable;
	testLocalVariable=45;
//	testLocalVariable=21;
	System.out.println("Local variable: " + testLocalVariable);
	
	
	System.out.println(finalObject.getA() +", " + finalObject.getB());	
	
	finalObject.setA(20);
	finalObject.setB(21);
	System.out.println(finalObject.getA() +", " + finalObject.getB());
    }
    
    public static void main(String[] args) {
	MyClass mc1= new MyClass(1,2);
	MyClass mc2= new MyClass(-1,-2);
	
	MyClass mc3= mc1;
	test(mc1,mc2);
	System.out.println();
	test(mc1,mc3);
    }
}
